//
//  SetTableViewCell.m
//  明和智能
//
//  Created by 李李善 on 2018/8/23.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "SetTableViewCell.h"

@implementation SetTableViewCell
-(void)onAsInitAddView:(UIView *)view forViewController:(UIViewController *)ViewController forDataSource:(id)dataSource AtIndexPath:(NSIndexPath *)indexPath
{
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    self.textLabel.font = kSysFont(kFitW(13));
    self.detailTextLabel.font = kSysFont(kFitW(11));
    
}
-(void)update:(NSDictionary *)model forTableView:(UITableView *)tableView AtIndexPath:(NSIndexPath *)indexPath
{
    self.textLabel.text = model[@"title"];
    self.detailTextLabel.text = model[@"detail"];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
@implementation SetTableViewCell1
-(void)onAsInitAddView:(UIView *)view forViewController:(UIViewController *)ViewController forDataSource:(id)dataSource AtIndexPath:(NSIndexPath *)indexPath
{
    self.textLabel.font = kSysFont(kFitW(13));
    UIImageView *imageV = ({
        UIImageView *l  = [UIImageView new];
        l.image = [UIImage imageNamed:@"wo_tx_img"];
        [view addV:l];
        l;
    });
    WSELF(weakSelf);
    [self onMainSetSubViewFrame:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        [weakSelf.textLabel sizeToFit];
        weakSelf.textLabel.left = kFitW(15);
        weakSelf.textLabel.centerY = size.height/2;
        
        imageV.size = CGSizeMake(kFitW(40), kFitW(40));
        imageV.right = size.width-kFitW(15);
        imageV.centerY = size.height/2;
    }];
}
-(void)update:(NSDictionary *)model forTableView:(UITableView *)tableView AtIndexPath:(NSIndexPath *)indexPath
{
    self.textLabel.text = model[@"title"];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
